package haiyangwangwork.day02.homework;

public class Triangle extends Polygon {
    int base;
    int height;
    public Triangle(int base,int height){
        super(3);
        this.base=base;
        this.height=height;
        System.out.println("在Triangle类的构造器中");
    }

    @Override
    public String toString() {
        return super.toString();
    }

    public int getArea(){

        System.out.println("三角形的面积为："+(base*height)/2);;
        return 0;
    }
}
